<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="manutencoesForm">

        <rich:panel>
            <f:facet name="header">Cadastrar Manutenções de Frota</f:facet>
			
			<h:panelGrid columns="1">
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">Tipo de manuntenção:</ui:define>
					<h:selectOneMenu value="#{cadastrarManutencao.idTipoSelecionado}"
						required="true">
						<f:selectItems value="#{cadastrarManutencao.listaTiposManutencao}"/>
					</h:selectOneMenu>
				</s:decorate>
				
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">Veículo:</ui:define>
					<h:outputText value="#{cadastrarManutencao.manutencaoEdicao.automovel.marca}/#{cadastrarManutencao.manutencaoEdicao.automovel.modelo}" />
				</s:decorate>
				
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">Data da manutenção:</ui:define>
					<rich:calendar value="#{cadastrarManutencao.manutencaoEdicao.data}"
						datePattern="dd/MM/yyyy"
						enableManualInput="true"
						showWeekDaysBar="false"
						oninputkeydown="Mascara(this,Data)"
						oninputkeyup="Mascara(this,Data)"
						required="true"/>
				</s:decorate>
				
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">Observação:</ui:define>
					<h:inputTextarea value="#{cadastrarManutencao.manutencaoEdicao.observacao}" 
						cols="70"
						rows="5"/>
				</s:decorate>
				
			</h:panelGrid>

        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="salvar" value="Salvar" action="#{cadastrarManutencao.salvar()}"
            	onclick="javascript:if(!confirm('Tem certeza que deseja salvar?'))return false;"/>
            <h:commandButton id="cancel" value="Cancelar" action="#{cadastrarManutencao.cancelar()}"
            	immediate="true"/>
        </div>

    </h:form>

 </ui:define>
</ui:composition>
